<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>
    <script src="../js/mui.min.js"></script>
    <link href="../css/mui.min.css" rel="stylesheet"/>
    <link href="../style/fjol_style.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="../style/xol_style.css"/>
    <link href="../css/iosSelect.css" rel="stylesheet" />
    <link href="../css/mui.picker.min.css" rel="stylesheet" />
    
    <script type="text/javascript" charset="utf-8">
      	mui.init();
    	
   		
    </script>
	</head>
	<style>
		.mui-input-row label~input, .mui-input-row label~select, .mui-input-row label~textarea{
			margin-right: 10px;
			width: 50%;
		}
		.mui-input-row .mui-input-clear~.mui-icon-clear, .mui-input-row .mui-input-password~.mui-icon-eye, .mui-input-row .mui-input-speech~.mui-icon-speech{
			width: 30px;
		}
	</style>
	<body>
		<header class="mui-bar mui-bar-nav newbgRed">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">有钱服务预约</h1>
		</header>
		<div class="mui-content">
		    <div class="mui-scroll-wrapper" style="bottom: 40px; top: 55px; background: #F5F7F7;">
		        <div class="mui-scroll">
		            <!--这里放置真实显示的DOM内容-->
		            <div class="mui-input-group">
					    <div class="mui-input-row">
					        <label>姓名</label>
					        <input type="text" id="realname" class="mui-input-clear mui-text-right" value="" placeholder="怎么称呼您？">
					    </div>
					    <div class="mui-input-row">
					        <label>手机号</label>
					        <input type="number" id="mobile" class="mui-input-clear mui-text-right" value="" placeholder="必填">
					    </div>
					</div>
		            
		        </div>
		    </div>
		    <nav class="mui-bar mui-bar-tab" style="background: none; box-shadow: none;">
		    	<button type="button" class="mui-btn mui-btn-blue colorWhite mui-btn-block pct80 mauto borderRadius6" id="submitIssue">确认发布</button>
		    </nav>
		</div>
		<script src="../js/md5.js"></script>
		<script src="../js/common.util.js"></script>
		<script src="../js/network.js"></script>
		<script src="../js/enum.util.js"></script>
		<script src="../js/mui.picker.min.js"></script>
		<script src="../js/mui.poppicker.js"></script>
		<script src="../css/iosSelect.js"></script>
		<script src="../js/xzx.open.js"></script>
		<script>
		mui('.mui-scroll-wrapper').scroll({
			deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
		});
		
		var type=1,shopId=1;
		var _url = '';
			
		mui.plusReady(function(){
			var wv = plus.webview.currentWebview();
			type = wv.type;		//1工装；2家装；3家政；4美食；5美食；6有钱
			shopId = wv.shopId;
			console.log(shopId);
			
			var userInfo = common.myStorage.getItem('userInfo');
			if(userInfo){
				document.querySelector('#realname').value = userInfo.realname;
				document.querySelector('#mobile').value = userInfo.mobile;
			}
			
			//提交
			document.querySelector('#submitIssue').addEventListener('tap',function(){

				var realname = document.querySelector('#realname').value;//姓名
				var mobile = document.querySelector('#mobile').value;//手机号
				
				var param;
				
				if(realname==''){
					mui.alert('请留下您的真实姓名，以便我们称呼您');
					return false;
				}
				if(mobile==''){
					mui.alert('请留下您的手机号，以便我们联系您');
					return false;
				}else if(!(/^1\d{10}$/.test(mobile))){
						mui.alert('请填写正确的手机号，以便我们联系您');
						return false;
				}
				param = [
				{
					key:'shopId',				//商家id
					value:shopId
				},{
					key:'realname',
					value:realname
				},{
					key:'mobile',
					value:mobile
				}];
				_url = 'finance/add.json';		//金融添加
			
				fjNetwork.post(_url,param,function(data){
//					console.log(_url);
					mui.toast('您的金融服务申请已经提交，我们将第一时间与您联系，请耐心等待');
					setTimeout(function(){
						mui.back();
					},1500);
				},function(msg){
//					console.log(msg);
					mui.toast(msg);
				});
				
				
			});
		
		});
		</script>
	</body>
</html>
